<div class="portlet light bordered">
	<div class="portlet-title">
		<div class="caption font-dark">
			<i class="fa fa-cog font-dark"></i> 
			<span class="caption-subject bold">查看链接</span>
		</div>
	</div>
	<div class="portlet-body form">
		<form role="form" class="form-horizontal"  >
			<div class="modal-body">
				 
				<div class="form-group">
					<label class="control-label col-md-3">预览链接：</label>
					<div class="col-md-7">
						<input type="text" class="form-control" name="link" id="pclink" readonly >
						<input type="hidden" name="id" id="id" value="$!id" />
					</div>
					<div class="col-md-2">
						<a class="btn green btn-outline btn-sm " href="javascript:copyLink('pclink');"> 
							<i class="fa fa-copy"></i>复制
						</a>
					</div>
				</div>
			</div>
			<div class="form-actions right">
                 <a href="javascript:;" data-dismiss="modal" class="btn btn-outline grey-salsa">返回</a>
            </div>
		</form>
	</div>
</div>
<script type="text/javascript">
$(function(){
	var domain = '$!portalDomain' ;
	var idv = $("#id").val() ;
	var pclink = domain+ "/definePage/preview?id="+idv ;
	$("#pclink").val(pclink);
})

function copyLink(inputId) {
	$("#"+inputId).select() ;
	document.execCommand("copy"); // 执行浏览器复制命令
}
</script>
 